#ifndef __WxVolumeRenderingPicker_H
#define __WxVolumeRenderingPicker_H

#include "mitkCommon.h"
#include "WxExtentionExports.h"
#include <mitkStateMachine.h>
#include <mitkVector.h>
#include <mitkDataNode.h>
#include "mitkWeakPointer.h"
#include <vtkRenderer.h>
namespace mitk {


  class WxExtention_EXPORT WxVolumeRenderingPicker : public mitk::StateMachine
  {
  public:
    mitkClassMacro(WxVolumeRenderingPicker, StateMachine);
    mitkNewMacro1Param(Self, const char*);
    DataNode* GetImageNode() {return m_ImageDataNode;}
    void SetImageNode(DataNode *imageNode){ m_ImageDataNode=imageNode;}
    DataNode* GetCrossBallNode() {return m_CrossBallNode;}
    void SetCrossBallNode(DataNode *surfaceNode){ m_CrossBallNode=surfaceNode;}


    itkSetMacro(MaxOpacity,float);
    itkGetMacro(MaxOpacity,float);
    itkSetMacro(MinValue,float);
    itkGetMacro(MinValue,float);
    itkSetMacro(Factor,float);
    itkGetMacro(Factor,float);
    itkSetMacro(Step,float);
    itkGetMacro(Step,float);

  protected:
    WxVolumeRenderingPicker(const char * type);
    virtual ~WxVolumeRenderingPicker();
    virtual bool ExecuteAction(Action* action, mitk::StateEvent const* stateEvent);    
    bool Get3DPixelUnder2DPosition(vtkRenderer* renderer,float x,float y,int pixel[],float pixPosition[],float* positionValue );
    inline int GetpixPosition(const float P0[3], const float P1[3],const float Pnormal[3],const float Ppoint[3], float resultPt[3] );


    mitk::WeakPointer<mitk::DataNode> m_ImageDataNode;
    float m_MaxOpacity,m_MinValue,m_Factor,m_Step;
    mitk::WeakPointer<mitk::DataNode> m_CrossBallNode;

  };

}
#endif //__WxVolumeRenderingPicker_H
